from Utilities.Stack import Stack


class TestStack:
    def setup_class(self):
        self.st = Stack()

    def _is_equal(self, x, expected):
        assert x == expected

    def test_push_pop_count(self):
        data = [1, 2, 3]

        for item in data:
            self.st.push(item)

        assert self.st.count() == len(data)
        for item in reversed(data):
            yield self._is_equal, self.st.pop(), item
